import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import {UserInfo} from './types';


export function listForUser(data: any) {
  return request({
    url: '/api/v1/user/list',
    method: 'post',
    data: data
  });
}

export function saveForUser(data: any) {
  return request({
    url: '/api/v1/user/save',
    method: 'post',
    data: data
  });
}

export function deleteForUser(data: any) {
  return request({
    url: '/api/v1/user/delete',
    method: 'post',
    data: data
  });
}

export function getUserInfo(): AxiosPromise<UserInfo> {
  return request({
    url: '/api/v1/user/info',
    method: 'get'
  });
}


export function resetPwdForUser(data: any){
  return request({
    url: '/api/v1/user/resetPwd',
    method: 'post',
	data:data
  });
}

export function listForUserAgent(data: any) {
  return request({
    url: '/api/v1/user/agent/list',
    method: 'post',
    data: data
  });
}

export function saveForUserAgent(data: any) {
  return request({
    url: '/api/v1/user/agent/save',
    method: 'post',
    data: data
  });
}


export function pagesForUserLog(data: any){
  return request({
    url: '/api/v1/user/log/pages',
    method: 'get',
	param:data
  });
}
